'''
Created on Apr 19, 2009

@author: Administrator
'''
from django.conf.urls.defaults import *
from django.conf import settings
from com.ericyang.groupshopping.order.models import GroupOrder
from com.ericyang.common.web import redirect, page404, response

urlpatterns = patterns('',
                       
    #create a new address book
    (r'^new/([^/]+)/$', "com.ericyang.groupshopping.order.views.create_order"),
    
    #create a new address book
    (r'^view/([^/]+)/$', "com.ericyang.groupshopping.order.views.view_order"),
    
    #list orders by product id
    (r'^list/product/([^/]+)/$', "com.ericyang.groupshopping.order.views.list_product_orders"),


    (r'^list/([^/]*)$', "com.ericyang.groupshopping.order.views.list_order"),
    
    #user add or remove
    (r'^user/handle/([^/]+)/$', "com.ericyang.groupshopping.order.views.user_add_or_remove_order"),
    
    #user add
    (r'^user/add/([^/]+)/$', "com.ericyang.groupshopping.order.views.user_save_order"),
       
    #vender add
    (r'^vendor/add/([^/]+)/$', "com.ericyang.groupshopping.order.views.add_vender"),
    
    #quit from a order
    (r'^quit/([^/]+)/$', "com.ericyang.groupshopping.order.views.quit_order"),
    
    #current user votes a vendor
    (r'^vote/([^/]+)/([^/]+)/$', "com.ericyang.groupshopping.order.views.user_vote"),
    
    #delte a address book
    (r'^([^/]+)/delete/$', 'com.ericyang.groupshopping.order.views.delete_order'),
    
    #cancel a address book
    (r'^([^/]+)/cancel/$', 'com.ericyang.groupshopping.order.views.cancel_order'),
    (r'^([^/]+)/stop_inviting/$', 'com.ericyang.groupshopping.order.views.stop_inviting'),
    (r'^([^/]+)/set_charging/$', 'com.ericyang.groupshopping.order.views.set_charging'),
    (r'^([^/]+)/success/$', 'com.ericyang.groupshopping.order.views.success_order'),
    (r'^([^/]+)/failed/$', 'com.ericyang.groupshopping.order.views.failed_order'),
    (r'^([^/]+)/vote/([^/]+)/$', 'com.ericyang.groupshopping.order.views.vote_order_vendor'),
    
    #edit a address book
    (r'^([^/]+)/$', 'com.ericyang.groupshopping.order.views.edit_order'),
    
    #default to create a new address book
    (r'^.*', "com.ericyang.groupshopping.order.views.list_order"),
)
